package cn.izeno.wx.models.web

import com.alibaba.fastjson.annotation.JSONField

/**
 * 1. [verifyFlag] & 8 != 0 ===> 公众号/服务号
 * 2. [username] in [SPECIAL_USER_NAME] ===> 特殊账号用户名
 * 3. [username] @@ 开头 ===> 群聊
 * 4. 自己
 * 5. 普通联系人
 */
class Member {

  @JSONField(name = "Alias")
  var alias = ""
  @JSONField(name = "AppAccountFlag", serialize = false)
  var appAccountFlag = 0
  @JSONField(name = "AttrStatus", serialize = false)
  var attrStatus: Long = 0
  @JSONField(name = "ChatRoomId")
  var chatRoomId = 0
  @JSONField(name = "City")
  var city = ""
  @JSONField(name = "ContactFlag")
  var contactFlag = 0
  @JSONField(name = "DisplayName")
  var displayName = ""
  @JSONField(name = "EncryChatRoomId")
  var encryChatRoomId = ""
  @JSONField(name = "HeadImgUrl")
  var headImgUrl = ""
  @JSONField(name = "HideInputBarFlag", serialize = false)
  var hideInputBarFlag = 0
  @JSONField(name = "IsOwner", serialize = false)
  var isOwner = 0
  @JSONField(name = "KeyWord", serialize = false)
  var keyWord = ""
  @JSONField(name = "MemberCount")
  var memberCount = 0
  @JSONField(name = "MemberList")
  var memberList = emptyList<Member>()
  @JSONField(name = "NickName")
  var nickname = ""
  @JSONField(name = "OwnerUin", serialize = false)
  var ownerUin = 0
  @JSONField(name = "PYInitial", serialize = false)
  var pyInitial = ""
  @JSONField(name = "PYQuanPin", serialize = false)
  var pyQuanPin = ""
  @JSONField(name = "Province")
  var province = ""
  @JSONField(name = "RemarkName")
  var remarkName = ""
  @JSONField(name = "RemarkPYInitial", serialize = false)
  var RemarkPYInitial = ""
  @JSONField(name = "RemarkPYQuanPin", serialize = false)
  var remarkPYQuanPin = ""
  @JSONField(name = "Sex")
  var sex = 0
  @JSONField(name = "Signature", serialize = false)
  var signature = ""
  @JSONField(name = "SnsFlag", serialize = false)
  var snsFlag = 0
  @JSONField(name = "StarFriend")
  var starFriend = 0
  @JSONField(name = "Statues")
  var statues = 0
  @JSONField(name = "Uin", serialize = false)
  var uin: Long = 0L
  @JSONField(name = "UniFriend", serialize = false)
  var uniFriend = 0

  @JSONField(name = "UserName")
  var username = "weixin"


  @JSONField(name = "VerifyFlag")
  var verifyFlag = 0

  companion object {
    /**
     * 特殊账号
     */
    val SPECIAL_USER_NAME = listOf(
        "filehelper", "weibo", "qqmail", "fmessage",
        "tmessage", "qmessage", "qqsync", "floatbottle",
        "lbsapp", "shakeapp", "medianote", "qqfriend",
        "readerapp", "blogapp", "facebookapp", "masssendapp",
        "meishiapp", "feedsapp", "voip", "blogappweixin",
        "brandsessionholder", "weixin", "weixinreminder",
        "officialaccounts", "wxitil", "notification_messages",
        "wxid_novlwrv3lqwv11", "gh_22b87fa7cb3c", "userexperience_alarm"
    )
  }
}